<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<title>飞机大战</title>
	</head>
	<body>
		<div id="stage" style="margin: 0 auto; width: 480px; height: 650px; text-align: center; vertical-align: middle" >
			<canvas id="canvas" style="border:2px solid red;" width="480" height="650">
				不支持画板对象
			</canvas>
		</div>
		<script>
			/**创建Ball构造方法,传入三个参数:type,color,size.*/
			function Ball(type, color, size) {
				this.type = type;
				this.color = color;
				this.size = size;
			}

			//创建数组balls,储存球对象,并传入参数 .
			var balls = [ 
			    new Ball("篮球", "橙色", "中号"),
			    new Ball("足球", "白色", "小号"),
			    new Ball("排球", "银色", "大号")];
			//在警告框上显示足球的信息.
			alert(balls[1].type + " : " + balls[1].color + " , " + balls[1].size);
		</script>
	</body>
</html>